<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改机房</title>
    <link rel="stylesheet" th:href="@{/lib/layui-v2.6.3/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/layuimini.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/themes/default.css}" media="all">
    <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
    <style>
        body{
            padding: 10px;
        }
    </style>
</head>
<body>
<table class="layui-hide" id="ID-table-demo-data"></table>
<script th:src="@{/lib/layui-v2.6.3/layui.js}" charset="utf-8"></script>
<script th:inline="javascript">
    var dmyata = /*[[${stuById}]]*/ '';
    console.log(dmyata)

    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#ID-table-demo-data',
            cols: [
                [   //表头
                    {field: 'examId', title: '考生编号',width:170,align:'center'},
                    {field: 'stuId', title: '学号',width:150,align:'center'},
                    {field: 'campus', title: '校区', width:120,align:'center',
                        templet:function (d) {
                            if(d.campus=='1') return '花津校区';
                            if(d.campus=='2') return '赭山校区';
                            if(d.campus=='3') return '天门山校区';
                        }
                    },
                    {field: 'stuName', title: '姓名',width:130,align:'center'},
                    {field: 'teaName', title: '教师',width:130,align:'center'},
                    {field: 'classId', title: '专业',width:130,align:'center'},
                ]
            ],
            data:dmyata,
            even:true,
            skin:"grid",
            page: true, // 是否显示分页
            limits: [8, 10, 12],
            limit: 10 // 每页默认显示的数量
        });
    });
</script>
</body>
</html>